package com.jdk.demo.thread.thread;

public class ThreadDemo {
	
	public static void main(String[] args) throws InterruptedException {
		Thread t = new Thread(() -> {
			System.out.println("===");
			try {
				Thread.sleep(100000);
			} catch (Exception e) {
				e.printStackTrace();
			}
		});
		// 这些设置不能放在start后面，因为有可能线程已经执行结束了，信息都被清除了，见《3sleep等》exit()
		t.setPriority(10);
		System.out.println(t.getThreadGroup());
		t.start();
		
		ThreadGroup mainGroup = t.getThreadGroup();
        Thread[] list = new Thread[mainGroup.activeCount()];
        int recurseSize = mainGroup.enumerate(list, false);
        System.out.println(recurseSize);
        
		Thread.sleep(1000000, 10000);
	}

}
